package com.ldzy.order.controller;

import com.ldzy.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.ldzy.common.pojo.Order;

@RestController
public class MyController {
    @Autowired
    private OrderService orderService;

    @PostMapping("/order/new")
    public boolean newOrder(@RequestBody Order order){
        //调用service
        boolean is=orderService.newOrder(order);
        return is;
    }

    @GetMapping("/order/hello")
    public String demo(){
        return "order,8003";
    }
}
